import cookie from '../utils/cookie'

export function updateUser (state, data) {
  state.user = data
}

export function updateToken (state, token) {
  state.token = token
  cookie.set('token', token, 1)
}

export function updateWs (state, ws) {
  state.ws = ws
}

export function pushMsg (state, msg) {
  state.msgArr.push(msg)
}
